﻿/*
 * Created by SharpDevelop.
 * User: Intel
 * Date: 20.12.2013
 * Time: 14:51
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Collections.Generic;

namespace Region.Test
{
  /// <summary>
  /// Description of Class1.
  /// </summary>
  public class Test1
  {
    static public Boolean Test()
    {
      List<List<Object>> Data = new List<List<Object>>(){
        new List<Object>(){"1ч. 20мин.",80,true},
        new List<Object>(){" 1ч. 20мин.",80,true},
        new List<Object>(){"1ч. 20мин. ",80,true},
        new List<Object>(){" 1ч. 20мин. ",80,true},
        new List<Object>(){"1ч.",60,true},
        new List<Object>(){"2ч.",120,true},
        new List<Object>(){"1.5",90,true},
        new List<Object>(){"1.5ч",90,true},
        new List<Object>(){"10 мин",10,true},
        new List<Object>(){"1:20мин.",80,true},
        new List<Object>(){"1 20",80,true},
        new List<Object>(){"",0,false},
        new List<Object>(){"1 2 3",0,false},
      };
      foreach(List<Object> i in Data)
      {
        String S = (String)i[0];
        Int32 V = (Int32)i[1];
        Boolean R = (Boolean)i[2];
        Int32 V1=0;
        Boolean R1= Utils.Convert.readTime(S,out V1);
        if (R1!=R || V!=V1) 
        {
          Console.WriteLine("Ошибка при проверке Utils.Convert.readTime при S='"+S+"'");
          return false;
        }
      }
      return true;
      /*int i0;bool b0 = Forms.RasporForm.readTime("1ч. 20мин.",out i0);
      int i1;bool b1 = Forms.RasporForm.readTime(" 1ч. 20мин.",out i1);
      int i2;bool b2 = Forms.RasporForm.readTime("1ч. 20мин. ",out i2);
      int i3;bool b3 = Forms.RasporForm.readTime(" 1ч. 20мин. ",out i3);
      int i4;bool b4 = Forms.RasporForm.readTime(" 1:20",out i4);
      int i5;bool b5 = Forms.RasporForm.readTime(" 1 20",out i5);
      int i6;bool b6 = Forms.RasporForm.readTime(" 1.5 ч",out i6);
      int i7;bool b7 = Forms.RasporForm.readTime(" 1.5 ч",out i7);
      int i8;bool b8 = Forms.RasporForm.readTime(" ",out i8);*/
      
    }
  }
}
